<p-panel class="staff" header="筛选查询" [collapsed]="false" headerClass="bg-eaeaea border-none" search="名称/内容" (onSearch)="searchData();dt.reset()"  [(searchText)]="infoStr">
    <div class="">
        <div class="inline-block">
            <span class="p-r-10 opacity06">网站：</span>
            <p-dropdown optionLabel="name" styleClass="width-150 m-r-30" [justValue]="true" dataKey="code" (onChange)="search();" [options]="siteArr" placeholder="请选择" [(ngModel)]="searchObj.siteCode" [style]="{width: '100%'}" ></p-dropdown>
        </div>
        <div class="inline-block org">
            <span class="p-r-10 opacity06">目录：</span>
            <p-treeselect [value]="tree" [filter]="true" placeholder="首页" [dataKey]="'code'" styleClass="width-150 m-r-30" selectionMode="single" [(selection)]="selectedFiles" (selectionChange)="search();"></p-treeselect>
        </div>
        <div class="inline-block">
            <span class="p-r-10 opacity06">是否包含子目录：</span>
            <p-dropdown optionLabel="name" styleClass="width-150 m-r-30" [justValue]="true" dataKey="code" (onChange)="search();" [options]="levelArr" placeholder="是" [(ngModel)]="searchObj.level" [style]="{width: '100%'}" ></p-dropdown>
        </div>
    </div>
</p-panel>
<!-- 搜索 end-->

<!-- 列表 begin-->
<p-dataTable #dt [marginHeight]="20" [style]="{marginTop:'20px'}" [value]="listData" [totalRecords]="totalRecords" [rows]="20" [rowsPerPageOptions]="[20,50,100,300]"
    [lazy]="true" (onLazyLoad)="loadCarsLazy($event)" scrollHeight="100px" [paginator]="true" [pageLinks]="4" [(selection)]="selectedItem"
    [headerCheckboxToggleAllPages]="true" [emptyMessage]="'没有搜到您想要的数据'">
    <p-header>
        <button pButton type="button" label="新增" class="btn btn-secondary" (click)="add()"></button>
        <button pButton type="button" label="删除" class="btn btn-secondary" (click)="delete()"></button>
    </p-header>
    <p-column [style]="{'width':'38px'}" selectionMode="multiple" ></p-column>
    <p-column *ngFor="let col of colsSelected" [field]='col.field' [header]='col.header' [sortable]="col.sortable" [style]="{'width':col.width}" >
        <ng-template let-index='rowIndex' let-data='rowData' pTemplate='body' *ngIf="col.tem">
            <div *ngIf="col.field === 'name'" (click)="edit(data.id)" style="color:#1a91eb;cursor:pointer;">
                {{data.name}}
            </div>
            <div *ngIf="col.field === 'imagePath'" (click)="lookImagesUrl= data.imagePath;lookImages.toggle($event)" style="color:#1a91eb;cursor:pointer;">
                查看
            </div>
            <div *ngIf="col.field === 'forwardUrl'" (click)="openWin(data.forwardUrl)" style="color:#1a91eb;cursor:pointer;">
                {{data.forwardUrl}}
            </div>
        </ng-template>
    </p-column>
</p-dataTable>
<!-- 列表 end-->
